<div class="mws-panel grid_8">
    <div class=" mws-button red">
        <?php echo $this->Html->link("Subjects", array("controller" => "subjects", 'action' => 'index')); ?>
    </div>
    <div class="mws-panel-header">
        <span class="mws-i-24 i-table-1"><?php echo __('Study Levels'); ?></span>
    </div>

    <div class="mws-panel-body">
        <div class="right_direction1">	 
            <table cellpadding="0" cellspacing="0"  class="mws-table">
                <thead>
                    <tr>
                        <th><?php echo $this->Paginator->sort('id'); ?></th>
                        <th><?php echo $this->Paginator->sort('title'); ?></th>
                        <th><?php echo $this->Paginator->sort('start_date'); ?></th>
                        <th><?php echo $this->Paginator->sort('subject_id'); ?></th>
                        <th><?php echo $this->Paginator->sort('is_paid'); ?></th>
                        <th><?php echo $this->Paginator->sort('price'); ?></th>
                        <th><?php echo $this->Paginator->sort('display_order'); ?></th> 
                        <th class="actions"><?php echo __('Actions'); ?></th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($studyLevels as $studyLevel): ?>
                        <tr>
                            <td><?php echo h($studyLevel['StudyLevel']['id']); ?>&nbsp;</td>
                            <td><?php echo h($studyLevel['StudyLevel']['title']); ?>&nbsp;</td>
                            <td><?php echo h(date("Y M d", strtotime($studyLevel['StudyLevel']['start_date']))); ?>&nbsp;</td>
                            <td>
                                <?php echo $this->Html->link($studyLevel['Subject']['name'], array('controller' => 'subjects', 'action' => 'view', $studyLevel['Subject']['id'])); ?>
                            </td>
                            <td><?php echo h($studyLevel['StudyLevel']['is_paid']); ?>&nbsp;</td>
                            <td><?php echo h($studyLevel['StudyLevel']['price']); ?>&nbsp;</td>
                            <td><?php echo h($studyLevel['StudyLevel']['display_order']); ?>&nbsp;</td>
                            <td class="actions">
                                <?php echo $this->Html->link(__('Manage lessons'), array("controller" => "lessons", 'action' => 'index', $studyLevel['StudyLevel']['id']), array("class" => "mws-ic-16 ic-hammer-screwdriver")); ?>
                                <?php echo $this->Html->link(__('Manage Quizzes'), array("controller" => "quizzes", 'action' => 'admin_qlevel', $subject['Subject']['id']), array("class" => "mws-ic-16 ic-hammer-screwdriver")); ?>
                                <?php echo $this->Html->link(__('View'), array('action' => 'view', $studyLevel['StudyLevel']['id']), array("class" => "mws-ic-16 ic-view")); ?>
                                <?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $studyLevel['StudyLevel']['id']), array("class" => "mws-ic-16 ic-hammer-screwdriver")); ?>
                                <?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $studyLevel['StudyLevel']['id']), array("class" => "mws-ic-16 ic-cross"), __('Are you sure you want to delete # %s?', $studyLevel['StudyLevel']['id'])); ?>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table> 
        </div> 
        <?php if ($this->Paginator->hasPrev() || $this->Paginator->hasNext()) { ?>	<p>
            <div class="mws-pagination">
                <?php
                echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
                echo $this->Paginator->numbers(array('separator' => '', "tag" => "li"));
                echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
                ?>

            </div>


        <?php } ?> 
        <div class='add-new'><?php echo $this->Html->link(__('New Level'), array('action' => 'add', $subject_id)); ?></div>	
        <div class="clear"></div>
    </div>
</div>

